import { modal } from 'vue-strap'
import { showMsg, msgSend } from '../../../../vuex/action'

export default {
  name: 'msg-confirm',
  data() {
    return {
      title: '确认提示框'
    }
  },
  props: ['showMsgConfirm', 'send'],
  components: {
    'vue-modal': modal
  },
  vuex: {
    actions: {
      xShowMsg: showMsg,
      xMsgSend: msgSend
    }
  },
  methods: {
    submit() {
      this.xMsgSend(this.send)
        .then(() => {
          this.showMsgConfirm = false
        })
        .catch((res) => {
          this.xShowMsg({
            type: 'danger',
            content: res.error_msg
          })
        })
    }
  }
}
